

//对外暴露路由
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('../views/login/loginIndex.vue'),
    name: 'login',
    meta: {
      title: '登录',
      hidden: true,
      icon: 'User'
    },

  },
  {
    path: '/',
    component: () => import('../layout/layoutIndex.vue'),
    name: 'layout',
    meta: {
      title: '',
      hidden: true,
      icon: 'More'
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('../views/home/homeIndex.vue'),
        name: 'home',
        meta: {
          title: '首页',
          hidden: false,
          icon: 'Compass',
        }
      },
    ]
  },
  {
    path: '/screen',
    component: () => import('../views/screen/index.vue'),
    name: 'Screen',
    meta: {
      title: '数据大屏',
      hidden: false,
      icon: 'MessageBox'
    }
  },
  {
    path: '/404',
    component: () => import('../views/404/index.vue'),
    name: '404',
    meta: {
      title: '404',
      hidden: true,
      icon: 'Switch'
    }
  },
]
//异步路由
export const asyncRoutes = [
  {
    path: '/acl',
    component: () => import('../layout/layoutIndex.vue'),
    name: 'Acl',
    redirect: '/acl/menu',
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'SwitchButton'
    },
    children: [
      {
        path: '/acl/menu',
        component: () => import('../views/acl/menu/index.vue'),
        name: 'Permission',
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'Link'
        }
      },
      {
        path: '/acl/part',
        component: () => import('../views/acl/part/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'ChatLineRound'
        }
      },
      {
        path: '/acl/user',
        component: () => import('../views/acl/user/index.vue'),
        name: 'User',
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'Message'
        }
      },
    ]
  },
  {
    path: '/product',
    component: () => import('../layout/layoutIndex.vue'),
    name: 'Product',
    meta: {
      title: '商品管理',
      hidden: false,
      icon: 'ChatRound',
    },
    redirect: '/product/attri',
    children: [
      {
        path: '/product/attri',
        component: () => import('../views/product/attri/index.vue'),
        name: 'Attr',
        meta: {
          title: '属性管理',
          hidden: false,
          icon: 'UserFilled'
        }
      },
      {
        path: '/product/grand',
        component: () => import('../views/product/grand/grandIndex.vue'),
        name: 'Trademark',
        meta: {
          title: '品牌管理',
          hidden: false,
          icon: 'WarnTriangleFilled'
        }
      },
      {
        path: '/product/sku',
        component: () => import('../views/product/sku/index.vue'),
        name: 'Sku',
        meta: {
          title: 'SKU管理',
          hidden: false,
          icon: 'HelpFilled'
        }
      },
      {
        path: '/product/spu',
        component: () => import('../views/product/spu/indexSpu.vue'),
        name: 'Spu',
        meta: {
          title: 'SPU管理',
          hidden: false,
          icon: 'Promotion'
        }
      },
    ]
  },
]

//任意路由
export const anyRoute = [
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'any',
    meta: {
      title: '任意路由',
      hidden: true,
      icon: 'Filter'
    }
  }
]